package internal

import (
	"context"
	
	dcsDb "fpgf/fpy/dcs/db"
	{{ImportContent}}
)

func init() {
	dcsDb.SetDbUrl("{{BaseUrlDb}}")
	dcsDb.SetDbSid("{{DbSid}}")
}

type {{TableFullName}}Dao struct {
	sid 	string
	dbSid   string
	table   string
	group   string
	columns T{{TableFullName}}Columns
}

type T{{TableFullName}}Columns struct {
{{ColumnsType}}
}


var c{{TableFullName}}Columns = T{{TableFullName}}Columns{
{{ColumnsContent}}
}

func New{{TableFullName}}Dao() *{{TableFullName}}Dao {
	return &{{TableFullName}}Dao{
		sid: 	"{{TableSid}}",
		dbSid:	"{{DbSid}}",
		group:   "{{TableGroupName}}",
		table:   "{{TableName}}",
		columns: c{{TableFullName}}Columns,
	}
}

func (dao *{{TableFullName}}Dao) Columns() T{{TableFullName}}Columns {
	return dao.columns
}

func (dao *{{TableFullName}}Dao) Group() string {
	return dao.group
}

func (dao *{{TableFullName}}Dao) Table() string {
	return dao.table
}

func (dao *{{TableFullName}}Dao) Ctx(ctx context.Context) *dcsDb.TDb {
	{{ProjectSidContent}}
	return dcsDb.Ctx(ctx).Table(dao.sid){{ProjectSidContent2}}
}